<template>
	<view v-if="imgHost" :style="theme">
		<view class="contents" :style="{background: navBj}">
			<!-- #ifdef MP-WEIXIN || APP-VUE || H5 || MP-QQ -->
			<u-navbar :placeholder="true" :bgColor="bgColor" title="首页">
				<view slot="left" class="flex locationb">
					<!-- <image :src="imgHost+'/ic_change.png'" mode="widthFix" class="changeImg"
						@click="jump2('/pages/venue/index')"></image>
					<view class="xian"></view> -->
					<image :src="imgHost+'/ic_saoma@2x.png'" mode="widthFix" class="saomaImg" @click="scanBtn"></image>
				</view>
			</u-navbar>
			<!-- #endif -->
			<!-- #ifdef MP-TOUTIAO -->
			<view class="douyinHead flex" :style="{background: bgColor}">
				<view class="flex locationb">
					<!-- <image :src="imgHost+'/ic_change.png'" mode="widthFix" class="changeImg"
						@click="jump2('/pages/venue/index')"></image>
					<view class="xian"></view> -->
					<image :src="imgHost+'/ic_saoma@2x.png'" mode="widthFix" class="saomaImg" @click="scanBtn"></image>
				</view>
				<view class="headBt">
					首页
				</view>
			</view>
			<!-- #endif -->
			<view class="content">
				<block v-for="(em, i) in homeList" :key="i">
					<div v-if="em.code == 'M_SHOP_BANNER'" class="mb3"
						style="width: 690rpx;margin: 0 auto 40rpx;position: relative;border-radius:8rpx;overflow: hidden;">
						<u-swiper v-if="lbList && lbList.length > 0" :list="lbList" indicator indicatorMode="dot"
							height="300rpx" circular @click="swiperClick" @change="swiperChange" radius="0"
							:current="swiperCurrent" keyName="imageFullPath" :autoplay="lbList.length > 1"></u-swiper>
						<!-- #ifdef MP-WEIXIN || MP-QQ -->
						<image v-if="lbList && lbList.length > 0 && lbList[swiperCurrent].videoId" class="videoImg"
							:src="imgHost + '/banner_ic_play.png'" @click.stop="videoBtn(lbList[swiperCurrent])">
						</image>
						<!-- #endif -->
						<view v-if="venueInfo.name && em.style == 2" class="venDetail">
							<view class="venTop flex">
								<image class="venImg" :src="venueInfo.showLogo" mode="aspectFit"
									@click="jump2('/pages/venue/detail?id=', venueId)"></image>
								<view class="venLeft" @click="jump2('/pages/venue/detail?id=', venueId)">
									<view class="f32 c2 fwb">
										{{venueInfo.name}}
									</view>
									<view class="f26 mt10">
										<text class="c6">营业时间：</text>
										<text class="c3">{{venueInfo.openTimeStart}} ~ {{venueInfo.openTimeEnd}}</text>
									</view>
								</view>
								<view class="venRight flex" @click="jump2('/pages/venue/index')">
									<image :src="imgHost + '/ic_qiehuan@2x.png'"></image></u-icon>切换
								</view>
							</view>
							<view class="venBottom flex">
								<view class="venLeft">
									<view class="f26 c3">
										{{venueInfo.address}}{{venueInfo.detailedAddress}}
									</view>
									<!-- <view class="f24 c9 mt10">
										1.3km
									</view> -->
								</view>
								<view class="venRight flex">
									<view v-if="venueInfo.latitudeLongitude" @click="call(venueInfo.telephone)">
										<image :src="imgHost + '/ic_dianhua.png'"></image>
										<text class="f22 c6">电话</text>
									</view>
									<view @click="navigation(venueInfo)">
										<image :src="imgHost + '/home_ic_location.png'"></image>
										<text class="f22 c6">导航</text>
									</view>
								</view>
							</view>
						</view>
					</div>
					<div v-if="em.code == 'M_SHOP_NOTICE' && textList && textList.length > 0" class="cardCont mb4">
						<u-notice-bar
							customStyle="box-shadow: 0rpx 2rpx 20rpx 0rpx rgba(0,0,0,0.08);border-radius: 8rpx;padding: 15rpx 30rpx;"
							:text="textList" direction="column" url="/subPackages/notice/index" color="#333333"
							fontSize="26rpx" :icon="imgHost+'/home_ic_notice.png'" bgColor="rgba(255,255,255,0.08)">
						</u-notice-bar>
					</div>
					<!-- :lxName="em.style==1?'hd':em.style==2?'dt':em.style==3?'zt':'sx'" -->
					<FlashSale v-if="em.code == 'M_SHOP_SECKILL'" :name="em.name" :lxName="em.style == '1'?'bt1':'wbt'" />
					<FlashSale v-if="em.code == 'M_SHOP_SECDISCOUNT'" :name="em.name"
						:lxName="em.style == '1'?'zbt':'bt2'" />
					<view v-if="em.code == 'M_SHOP_FUNCTION'  && em.name && em.venueContents && em.venueContents.length > 0"
						class="dbt flex flex_between">
						<view class="left">
							{{em.name}}
						</view>
					</view>
					<view v-if="em.code == 'M_SHOP_FUNCTION' && em.venueContents && em.venueContents.length > 0"
						class="service_box mb32">
						<view v-for="(s, m) in em.venueContents" :key="m" class="service_box_item"
							:class="'w' + em.rowNum" @click="jumps(s)">
							<view class="service_box_iteM_SHOP_icon">
								<image :src="s.icon"></image>
							</view>
							<text class="service_box_iteM_SHOP_text">{{s.title}}</text>
						</view>
					</view>
					<view v-if="em.code == 'M_SHOP_PROJECT' && em.name" class="dbt flex flex_between">
						<view class="left">
							{{em.name}}
						</view>
					</view>
					<view v-if="em.code == 'M_SHOP_PROJECT'" class="hdList cardCont mb32">
						<view v-for="(item, index) in list" :key="index" class="hdli"
							:class="em.paramShow.indexOf('3') > -1?'w' + em.rowNum:'wu w' + em.rowNum"
							:style="{backgroundImage: 'url(' + item.showBgPic + ')'}" @click="projectJump(item)">
							<view v-if="em.paramShow.indexOf('2') > -1" class="kuan">
								<image :src="item.showProjectPictures"></image>
							</view>
							<view v-if="em.paramShow.indexOf('1') > -1" class="hdWz limit-1-line">
								{{item.projectName}}
							</view>
						</view>
					</view>
					<ShortcutTab v-if="em.code == 'M_SHOP_SITE'" :showList="em.paramShow" :contentType="em.style" />
					<view v-if="em.code == 'M_SHOP_COURSE' && em.name && kcList&&kcList.length>0"
						class="dbt flex flex_between">
						<view class="left">
							{{em.name}}
						</view>
						<view class="right flex" @click="jump2('/pages/curriculum/index','', 1)">
							<text style="margin-right: 5rpx;">查看更多</text>
							<u-icon name="arrow-right" color="#999999" size="20rpx"></u-icon>
						</view>
					</view>
					<KcList v-if="em.code == 'M_SHOP_COURSE'" :showList="em.paramShow" :list="kcList"
						:lxName="em.style==1?'hd':em.style==2?'dt':em.style==3?'zt':'sx'" />
					<view v-if="em.code == 'M_SHOP_COURSE' && kcList && kcList.length>0" :showList="em.paramShow"
						style="height: 22rpx;"></view>
					<view v-if="em.code == 'M_SHOP_MEALS'  && em.name &&setmealList&&setmealList.length>0"
						class="dbt flex flex_between">
						<view class="left">
							{{em.name}}
						</view>
						<view class="right flex" @click="jump2('/pages/setmeal/index','', 1)">
							<text style="margin-right: 5rpx;">查看更多</text>
							<u-icon name="arrow-right" color="#999999" size="20rpx"></u-icon>
						</view>
					</view>
					<TcList v-if="em.code == 'M_SHOP_MEALS'" :showList="em.paramShow" :list="setmealList"
						:lxName="em.style==1?'hd':em.style==2?'dt':em.style==3?'zt':'sx'" />
					<!-- 教师 -->
					<view v-if="em.code == 'M_SHOP_TEACHER'  && em.name && teacherList&&teacherList.length>0"
						class="dbt flex flex_between">
						<view class="left">
							{{em.name}}
						</view>
					</view>
					<Teacher v-if="em.code == 'M_SHOP_TEACHER'" :list="teacherList" :showList="em.paramShow"
						:lxName="em.style==1?'hd':'zt'" />
					<!-- 教师 -->
					<view v-if="em.code == 'M_SHOP_MEALS' && setmealList && setmealList.length>0" :showList="em.paramShow"
						style="height: 22rpx;"></view>
					<view v-if="em.code == 'M_SHOP_ACTIVITY'  && em.name && hdList&&hdList.length>0"
						class="dbt flex flex_between">
						<view class="left">
							{{em.name}}
						</view>
						<view class="right flex" @click="jump2('/pages/activity/index','', 1)">
							<text style="margin-right: 5rpx;">查看更多</text>
							<u-icon name="arrow-right" color="#999999" size="20rpx"></u-icon>
						</view>
					</view>
					<HdList v-if="em.code == 'M_SHOP_ACTIVITY'" :showList="em.paramShow" :list="hdList"
						:lxName="em.style==1?'hd':em.style==2?'dt':'zt'" />
					<view v-if="em.code == 'M_SHOP_ACTIVITY' && hdList && hdList.length>0" :showList="em.paramShow"
						style="height: 22rpx;"></view>
					<view v-if="em.code == 'M_SHOP_KNOWLEDGE'  && em.name &&zsList&&zsList.length>0"
						class="dbt flex flex_between">
						<view class="left">
							{{em.name}}
						</view>
						<view class="right flex" @click="jump2('/pages/sport/index')">
							<text style="margin-right: 5rpx;">查看更多</text>
							<u-icon name="arrow-right" color="#999999" size="20rpx"></u-icon>
						</view>
					</view>
					<YdList v-if="em.code == 'M_SHOP_KNOWLEDGE'" :showList="em.paramShow" :list="zsList"
						:lxName="em.style==1?'hd':em.style==2?'dt':em.style==3?'zt':'sx'" />
					<view v-if="em.code == 'M_SHOP_KNOWLEDGE' && zsList && zsList.length>0" :showList="em.paramShow"
						style="height: 22rpx;"></view>
					<!-- Integral 积分 -->
					<view v-if="em.code == 'M_SHOP_INTEGRAL_SHOP' && em.name && jfList&&jfList.length>0"
						class="dbt flex flex_between">
						<view class="left">
							{{em.name}}
						</view>
						<view class="right flex" @click="jump2('/pages/integral/index','', 1)">
							<text style="margin-right: 5rpx;">查看更多</text>
							<u-icon name="arrow-right" color="#999999" size="20rpx"></u-icon>
						</view>
					</view>
					<Integral v-if="em.code == 'M_SHOP_INTEGRAL_SHOP'" :list="jfList" />
					<view v-if="em.code == 'M_SHOP_VENUE'  && em.name && venList&&venList.length>0"
						class="dbt flex flex_between">
						<view class="left">
							{{em.name}}
						</view>
						<view class="right flex" @click="jump2('/pages/venue/list','', 1)">
							<text style="margin-right: 5rpx;">查看更多</text>
							<u-icon name="arrow-right" color="#999999" size="20rpx"></u-icon>
						</view>
					</view>
					<HotVen v-if="em.code == 'M_SHOP_VENUE'" :showList="em.paramShow" :list="venList" />
				</block>
			</view>
			<view style="height: 100rpx;"></view>
		</view>
		<u-popup :show="showKp" mode="center" round="20rpx" custom-style="background: none">
			<view class="kpgg">
				<image :src="sygg.imageFullPath" mode="widthFix" @click="ggBtn"></image>
				<u-icon name="close" size="64rpx" color="white" @click="gbShowKp" />
			</view>
		</u-popup>
		<u-popup :show="showYhj" mode="center" round="20rpx"
			custom-style="background: rgba(0, 0, 0, 0.5);width: 100%;height: 100%;align-items: center;display: flex;flex-direction: column;justify-content: center;"
			zIndex="88888">
			<view class="kpggs">
				<image :src="imgHost+'/coupon_bg_1_01.png'" mode="widthFix"></image>
				<view class="yhjCnt">
					<image :src="imgHost+'/coupon_bg_1_02.png'"
						:style="{height:Number(yhjList.length * 146 - 12) +'rpx'}">
					</image>
					<view class="yhjBox flex" v-for="(item, index) in yhjList" :key="index" @click="gbShowYhj(index)">
						<view class="yhjTip">专属</view>
						<view v-if="item.disType == 1 || item.type == 2" class="left">
							¥<text>{{item.price}}</text>
						</view>
						<view v-else class="left b">
							<text>{{Number(item.price * 10).toFixed(1)}}</text>折
						</view>
						<view class="right">
							<view class="f30 c2 fw5 limit-1-line">{{item.name}}</view>
							<view v-if="item.endTime" class="f24">有效期至{{item.endTime.slice(0,10)}}</view>
						</view>
					</view>
				</view>
				<image :src="imgHost+'/coupon_front.png'" mode="widthFix" class="coupon_front"></image>
				<image :src="imgHost+'/ic_coin.png'" mode="widthFix" class="ic_coin"></image>
				<view class="coupon_btn" @click="gbShowYhj(0)">
					<image :src="imgHost+'/coupon_btn.png'" mode="widthFix"></image>
				</view>
				<image :src="imgHost+'/coupon_close.png'" mode="widthFix" class="gbImg" @click="gbShowYhjBtn"></image>
			</view>
		</u-popup>
	</view>
</template>

<script>
	import {
		mapState
	} from "vuex";
	import KcList from "@/components/kcList.vue";
	import YdList from "@/components/ydList.vue";
	import TcList from "@/components/tcList.vue";
	import HdList from "@/components/hdList.vue";
	import Teacher from "@/components/teacher.vue";
	import ShortcutTab from "@/components/shortcutTab.vue";
	import FlashSale from "@/components/flashSale.vue";
	import Integral from "@/components/integral.vue";
	import HotVen from "@/components/hotVen.vue";
	export default {
		props: {
			venueInfo: {
				type: Object,
				default: () => {},
			}
		},
		components: {
			KcList,
			HotVen,
			Integral,
			YdList,
			Teacher,
			HdList,
			TcList,
			ShortcutTab,
			FlashSale
		},
		computed: mapState(["tabUrl"]),
		data() {
			return {
				bgColor: 'rgba(255,255,255,0)',
				tabIndex: '/pages/index/index',
				name: '',
				yhjList: [],
				venList: [],
				venueList: [],
				lbList: [],
				showKp: false,
				sygg: {},
				jfList: [],
				textList: [],
				indicator: false,
				list: [],
				kcList: [],
				teacherList: [],
				hdList: [],
				zsList: [],
				setmealList: [],
				homeList: [],
				navBj: '',
				swiperCurrent: 0,
				showYhj: false
			}
		},

		mounted() {
			//监听下拉加载更多
			let that = this
			// #ifdef H5
			this.bgColor = 'rgba(255,255,255,1)'
			// #endif 
			uni.$on('onReachBottom', () => {
				console.log('触发触底')
			})
			// 页面滚动了
			uni.$on('onPageScroll', function(data) {
				// console.log("页面滚动了")
				// console.log('data=', data)
				that.scrollBtn(data)
				//执行其他内容
			})
		},
		beforeDestroy() {
			uni.$off('onReachBottom');
			uni.$off('onPageScroll');
		},
		methods: {
			jump2(url, params, a) {
				const tabUrl = this.tabUrl
				if (tabUrl.includes(url)) {
					this.$emit("bacBtn", url);
				} else {
					uni.navigateTo({
						url: params ? url + params  + '&indexShop=1' : url + '?indexShop=1',
					});
				}
			},
			videoBtn(item) {
				console.log('弹出1次')
				var that = this;
				wx.openChannelsActivity({
					finderUserName: item.videoNumberId,
					feedId: item.videoId,
					success(res) {
						console.log('成功3', res)
					},
					fail(err) {
						console.log('取消3?', err)
					}
				});
				// wx.getChannelsLiveInfo({
				// 	finderUserName: item.videoNumberId,
				// 	success(res) {
				// 		console.log('成功', res)
				// 	},
				// 	fail(err) {
				// 		console.log('取消?', err)
				// 	}
				// });
				// wx.openChannelsLive({
				// 	finderUserName: item.videoNumberId,
				// 	success(res) {
				// 		console.log('成功1', res)
				// 	},
				// 	fail(err) {
				// 		console.log('取消1?', err)
				// 	}
				// });
			},
			scanBtn() {
				if (!this.userInfo) {
					this.$app.showToast('未登录，请先登录！')
					setTimeout(() => {
						// #ifdef MP
						this.jump2('/pages/home/login')
						// #endif 
						// #ifdef H5
						this.jump2('/pages/home/loginb')
						// #endif 
					}, 1000);
					return false
				}
				let that = this
				// #ifdef MP
				uni.scanCode({
					success(res) {
						if (res.path) {
							that.jump2('/' + res.path)
						} else if (res.result) {
							if (res.result.indexOf('pages/parking/index') > -1) {
								that.jump2(res.result)
							} else {
								that.handleQRCode(res.result)
							}
						}
					}
				})
				// #endif 
				// #ifdef H5
				this.onScan()
				// #endif
			},
			// h5扫描二维码并解析
			onScan() {
				let that = this
				wx.scanQRCode({
					needResult: 1, // 默认为0，扫描结果由微信处理，1则直接返回扫描结果，
					scanType: ['qrCode', 'barCode'], // 可以指定扫二维码还是一维码，默认二者都有
					desc: 'scanQRCode desc',
					success: function(res) {
						var result = res.resultStr; // 当 needResult 为 1 时，扫码返回的结果
						var resultArr = result.split(','); // 扫描结果以逗号分割数组(一维码)
						var codeContent = resultArr[resultArr.length - 1]; // 获取数组最后一个元素，也就是最终的内容 
						if (res.path) {
							that.jump2('/' + res.path)
						} else if (result) {
							if (result.indexOf('pages/parking/index') > -1) {
								that.jump2(result)
							} else {
								that.handleQRCode(result)
							}
						}
					},
					fail: function(response) {
						console.log("调用wx.scanQRCode扫码失败");
					},
				});
			},
			handleQRCode(code) {
				this.$app.ajax({
					data: {
						param: {
							code
						}
					},
					api: this.$api.handleQRCode()
				}).then((res) => {
					if (res.errorCode === '000000') {
						if (res.record.flag == 1) {
							if (res.record.type == 1) {
								if (res.record.recordId) {
									this.jump2('/pages/member/signin?id=', res.record.recordId)
								} else {
									this.$app.showToast('签到成功')
								}
							} else if (res.record.type == 2) {
								this.$app.showToast('扫码签到成功')
							} else if (res.record.type == 3) {
								this.$app.showToast('用户授权成功')
							} else if (res.record.type == 4) {
								if (res.record.recordId) {
									this.jump2('/pages/member/signins?id=', res.record.recordId)
								} else {
									this.$app.showToast('签到成功')
								}
							}
						} else {
							if (res.record.type == 1 && res.record.recordId) {
								this.jump2('/pages/member/signin?id=', res.record.recordId)
							} else {
								this.$app.showToast('扫码失败')
							}
						}
					}
				}).catch(() => {})
			},
			call(phone) {
				uni.makePhoneCall({
					phoneNumber: phone,
					success: function() {
						console.log('拨打电话成功');
					},
					fail() {
						console.log('打电话失败了');
					}
				})
			},
			navigation(info) {
				let data = info.latitudeLongitude.split(',')
				uni.openLocation({
					longitude: Number(data[0]),
					latitude: Number(data[1]),
					name: info.name,
					address: info.name,
					success() {
						console.log('success');
					}
				})
			},
			projectJump(item) {
				if (item.type == '1') {
					// this.jump2('/pages/ticket/ticketPurchaseDetails?id=',item.id)
					this.jump2('/pages/ticket/index?id=', item.id)
				} else {
					this.jump2('/pages/venue/fieldArea?id=', item.id + '&name=' + item.projectName)
				}

			},
			scrollBtn(scrollTop) {
				// #ifndef H5
				let topOpacity = scrollTop / 100 - .4
				if (scrollTop < 40) {
					topOpacity = 0
				} else if (topOpacity >= 1) {
					topOpacity = 1
				}
				this.bgColor = `rgba(255,255,255,${topOpacity})`
				// #endif 
			},
			teacherAllList() {
				this.$app.ajax({
					data: {
						param: {
							isOnJob: '1',
							status: '1',
							venueId: this.venueId
						}
					},
					api: this.$api.teacherList()
				}).then((res) => {
					if (res.errorCode === '000000') {
						this.teacherList = res.recordList || []
					}
				}).catch(() => {})
			},
			showTab(type) {
				if (this.venue || type === 'start') {
					this.$store.commit('setVenue', false);
					this.getAppHomeRenovationInfo()
				} else {
					this.getagcDataByMember()
				}
				if (this.userInfo && uni.getStorageSync('shareMemberId') && uni.getStorageSync('shareMemberId') !=
					'undefined') {
					this.addShareMemberRelevance(uni.getStorageSync('shareMemberId'))
				}
				
			},
			addShareMemberRelevance(shareMemberId) {
				this.$app.ajax({
					data: {
						param: {
							shareMemberId
						}
					},
					api: this.$api.addShareMemberRelevance()
				}).then((res) => {
					if (res.errorCode === '000000') {
						uni.removeStorageSync('shareMemberId');
					}
				})
			},
			getAppHomeRenovationInfo() {
				this.homeList = []
				this.$app.ajax({
					data: {
						param: {
							code: 'T_SHOP_HOME'
						}
					},
					api: this.$api.getAppHomeRenovationInfo()
				}).then((res) => {
					if (res.errorCode === '000000') {
						let arr = res.recordList
						let obj = {}
						arr.forEach(s => {
							if (s.paramList && s.paramList.length > 0) {
								s.paramShow = s.paramList.map(s => s.key)
							} else {
								s.paramShow = []
							}
							obj[s.code] = s
						})
						this.homeList = arr
						if (obj['M_SHOP_BANNER'] && obj['M_SHOP_BANNER'].paramList && obj['M_SHOP_BANNER'].paramShow.indexOf(
								'1') > -1) {
							this.navBj = 'linear-gradient(180deg,' + 'var(--color2)' + ' 0%, var(--bjColor) 100%)'
						} else {
							this.navBj = ''
						}
						if (obj['M_SHOP_BANNER']) {
							this.getBanner()
						}
						if (obj['M_SHOP_NOTICE']) {
							this.getInfo()
						}
						if (obj['M_SHOP_PROJECT']) {
							this.getProject()
						}
						if (obj['M_SHOP_COURSE']) {
							this.hotCourseList()
						}
						if (obj['M_SHOP_KNOWLEDGE']) {
							this.getZsList()
						}
						if (obj['M_SHOP_ACTIVITY']) {
							this.getActivityListMini()
						}
						if (obj['M_SHOP_MEALS']) {
							this.getMealsOnlineList()
						}
						if (obj['M_SHOP_TEACHER']) {
							this.teacherAllList()
						}
						if (obj['M_SHOP_INTEGRAL_SHOP']) {
							this.getJfList()
						}
						if (obj['M_SHOP_VENUE']) {
							this.getVenList()
						}
					}
				})
			},
			getVenList() {
				this.$app.ajax({
					api: this.$api.hotVenue(),
					data: {
						pagination: {
							firstQueryTime: this.$app.firstQueryTime(),
							page: 1,
							rows: 6
						},
						param: {
							memberId: this.userInfo.id,
							openStatus: '1',
							isRec: '1'
						}
					}
				}).then((res) => {
					if (res.errorCode === '000000') {
						this.venList = res.recordList || []
					}
				}).catch(() => {})
			},
			getJfList() {
				this.$app.ajax({
					api: this.$api.homeGoodsList(),
					data: {
						pagination: {
							firstQueryTime: this.$app.firstQueryTime(),
							page: 1,
							rows: 6
						},
						param: {
							memberId: this.userInfo.id,
							isRec: '1',
							venueId: this.venueId
						}
					}
				}).then((res) => {
					if (res.errorCode === '000000') {
						this.jfList = res.recordList || []
					}
				}).catch(() => {})
			},
			// 判断跳转
			jumps(s) {
				if (s.url === 'member') {
					if (this.userInfo.isNormal == '1') {
						this.jump2('/pages/member/recharge')
					} else {
						this.jump2('/pages/member/handle')
					}
				} else {
					if (s.appId) {
						uni.navigateToMiniProgram({
							appId: s.appId, //目标小程序appid
							path: s.url, //需要打开的目标路径
							success(res) {
								// 打开成功
							}
						})
					} else if (s.urlType == '2') {
						this.jump2('/pages/index/web?url=', s.url)
					} else {
						if (s.url === '/subPackages/motion/index') {
							this.$app.ajax({
								data: {
									param: {}
								},
								api: this.$api.momOpenStatus()
							}).then(res => {
								if (res.errorCode === '000000') {
									const momConfig = res.record || {}
									if (momConfig.status === '0') {
										this.jump2('/subPackages/motion/index')
									} else {
										this.jump2('/subPackages/motion/indexMiddle')
									}
								}
							})
						
						} else {
							this.jump2(s.url)
						}
					}
				}
			},
			getActivityListMini() {
				this.$app.ajax({
					data: {
						pagination: {
							firstQueryTime: this.$app.firstQueryTime(),
							page: 1,
							rows: 6
						},
						param: {
							venueId: this.venueId,
							isRec: '1'
						}
					},
					api: this.$api.activityListMini()
				}).then((res) => {
					if (res.errorCode === '000000') {
						this.hdList = res.recordList || []
					}
				}).catch(() => {})
			},
			getMealsOnlineList() {
				this.$app.ajax({
					api: this.$api.mealsOnlineList(),
					data: {
						pagination: {
							page: 1,
							rows: 9
						},
						param: {
							venueId: this.venueId,
							isRec: '1'
						}
					}
				}).then((res) => {
					if (res.errorCode === '000000') {
						this.setmealList = res.recordList || []
					}
				}).catch(() => {})
			},
			getZsList() {
				this.$app.ajax({
					data: {
						pagination: {
							firstQueryTime: this.$app.firstQueryTime(),
							page: 1,
							rows: 6
						},
						param: {
							venueId: this.venueId,
							isRec: '1',
							type: '1'
						}
					},
					api: this.$api.listWXKnowledge()
				}).then((res) => {
					if (res.errorCode === '000000') {
						this.zsList = res.recordList || []
					}
				}).catch(() => {})
			},
			hotCourseList() {
				this.$app.ajax({
					data: {
						pagination: {
							firstQueryTime: this.$app.firstQueryTime(),
							page: 1,
							rows: 6
						},
						param: {
							venueId: this.venueId,
							channel: '01',
							isRec: '1'
						}
					},
					api: this.$api.hotCourseList()
				}).then((res) => {
					if (res.errorCode === '000000') {
						this.kcList = res.recordList || []
					}
				}).catch(() => {})
			},
			getProject() {
				this.$app.ajax({
					data: {
						param: {
							venueId: this.venueId,
							// type: "0",
							isRec: '1',
							status: '1'
						},
						pagination: {
							firstQueryTime: this.$app.firstQueryTime(),
							page: 1,
							rows: 9
						},
					},
					api: this.$api.getProject()
				}).then((res) => {
					if (res.errorCode === '000000') {
						this.list = res.recordList || []
					}
				}).catch(() => {})

			},
			getMemberInformation() {
				// this.$app.ajax({
				// 	data: {
				// 		param: {}
				// 	},
				// 	api: this.$api.memberInformation()
				// }).then((res) => {
				// 	if (res.errorCode === '000000') {
				// 		this.$store.commit('saveUserInfo', res.record);
				// 		if (uni.getStorageSync('shareMemberId')) {
				// 			this.addShareMemberRelevance(uni.getStorageSync('shareMemberId'))
				// 		}
				// 	}
				// }).catch(() => {})
				if (this.userInfo) {
					this.addShareMemberRelevance(scene)
				}
			},
			// 获取轮播图
			getBanner() {
				this.$app.ajax({
					data: {
						param: {
							venueId: this.venueId,
							type: '4',
							isRec: '1'
						},
						pagination: {
							page: 1,
							rows: 5
						},
					},
					api: this.$api.queryApplets()
				}).then((res) => {
					if (res.errorCode === '000000') {
						let arr = res.record || []
						this.lbList = arr
					} else {
						this.lbList = []
					}
				}).catch(() => {
					this.lbList = []
				})
				this.$app.ajax({
					data: {
						param: {
							venueId: this.venueId,
							type: '1',
							isRec: '1'
						},
						pagination: {
							page: 1,
							rows: 6
						},
					},
					api: this.$api.queryApplets()
				}).then((res) => {
					if (res.errorCode === '000000') {
						let arr = res.record || []
						let sygg = {}
						let showKp = false
						arr.forEach(e => {
							if (e.type == 1) {
								sygg = e
								showKp = true
							}
						})
						this.sygg = sygg
						this.showKp = showKp
					}
				}).catch(() => {
				})
			},
			getagcDataByMember() {
				this.$app.ajax({
					data: {
						param: {},
					},
					api: this.$api.agcDataByMember()
				}).then((res) => {
					if (res.errorCode === '000000') {
						let arr = res.recordList || []
						this.yhjList = arr
						if (arr.length > 0) {
							this.showYhj = true
						} else {
							this.showYhj = false
						}
					} else {
						this.showYhj = false
					}
				}).catch(() => {})
			},
			getInfo() {
				this.$app.ajax({
					data: {
						pagination: {
							firstQueryTime: this.$app.firstQueryTime(),
							page: 1,
							rows: 10
						},
						param: {
							memberId: this.userInfo.id,
							venueId: this.venueId,
							isRec: '1',
							type: this.userInfo && this.userInfo.id ? '4' : '2'
						}
					},
					api: this.$api.getInfo()
				}).then((res) => {
					if (res.errorCode === '000000') {
						let arr = res.recordList || []
						this.textList = arr.map((e) => e.content)
					}
				}).catch(() => {})
			},
			swiperClick(e) {
				let obj = this.lbList[e]
				if (obj.jumpPath && obj.idKey && obj.paramValue) {
					if (this.tabUrl.includes(obj.jumpPath)) {
						return this.$emit("bacBtn", obj.jumpPath);
					}
					this.jump2(obj.jumpPath + "?" + obj.idKey + '=' + obj.paramValue)
				}
			},
			swiperChange(e) {
				this.swiperCurrent = e.current
			},
			gbShowKp() {
				this.showKp = false
			},
			gbShowYhjBtn() {
				this.showYhj = false
			},
			gbShowYhj(index) {
				if (this.yhjList[index].type == 2) {
					this.jump2('/subPackages/setmeal/index')
				} else {
					this.jump2('/pages/member/coupon')
				}
				this.showYhj = false
			},
			ggBtn() {
				let obj = this.sygg
				if (obj.jumpPath && obj.idKey && obj.paramValue) {
					this.showKp = false
					if (this.tabUrl.includes(obj.jumpPath)) {
						return this.$emit("bacBtn", obj.jumpPath);
					}
					this.jump2(obj.jumpPath + "?" + obj.idKey + '=' + obj.paramValue)
				}
			},
			onPageScroll(res) {
				// #ifndef H5
				let topOpacity = res.scrollTop / 100 - .4
				if (res.scrollTop < 40) {
					topOpacity = 0
				} else if (topOpacity >= 1) {
					topOpacity = 1
				}
				this.bgColor = `rgba(255,255,255,${topOpacity})`
				// #endif 
			}
		}
	}
</script>
<style lang="scss" scoped>
	.contents {
		height: 500rpx;
	}

	.location {
		&.zjtd {
			height: 100rpx;
			padding: 0 30rpx;
			box-sizing: border-box;
			position: sticky;
			top: 0;
			left: 0;
			width: 100%;
		}

		.locationImg {
			width: 36rpx;
			height: 36rpx;
		}

		.locationName {
			font-size: 32rpx;
			font-family: PingFangSC-Medium, PingFang SC;
			font-weight: Medium;
			margin: 0 20rpx;
			color: $wzColor;
		}

		.locationIcon {
			width: 22rpx;
			height: 22rpx;
		}

		&.zts {
			.locationName {
				color: #333;
			}
		}
	}

	.locationb {
		width: 100rpx;
		height: 64rpx;
		background: rgba(255, 255, 255, 0.6);
		border-radius: 32rpx;
		border: 1rpx solid rgba(0, 0, 0, 0.08);
		justify-content: center;
		padding: 0 24rpx;
		box-sizing: border-box;

		image {
			width: 34rpx;
			height: 34rpx;
		}

		.xian {
			width: 1rpx;
			height: 30rpx;
			background-color: #E5E5E5;
		}
	}

	.douyinHead {
		height: 100rpx;
		padding: 0 30rpx;
		box-sizing: border-box;
		position: sticky;
		top: 0;
		left: 0;
		width: 100%;
		z-index: 99;

		.headBt {
			position: absolute;
			left: 50%;
			top: 0;
			margin-left: -50rpx;
			font-size: 32rpx;
			font-family: PingFangSC, PingFang SC;
			font-weight: Medium;
			color: #111111;
			width: 100rpx;
			text-align: center;
			line-height: 100rpx;
		}
	}

	.content {
		// width: 690rpx;
		margin: 30rpx auto 0;

	}

	.dbt {
		font-size: 26rpx;
		margin: auto auto 35rpx;
		color: #666666;
		width: 690rpx;

		.left {
			font-size: 34rpx;
			font-weight: 600;
			color: #222222;
		}

		.right {
			font-size: 26rpx;
			font-family: PingFangSC-Regular, PingFang SC;
			font-weight: 400;
			color: #999999;
		}
	}

	.hdList {
		display: flex;
		flex-wrap: wrap;

		.hdli {
			border-radius: 8rpx;
			margin-right: 15rpx;
			background-color: #fff;
			margin-bottom: 20rpx;
			display: flex;
			align-items: center;
			flex-direction: column;
			justify-content: center;
			text-align: center;
			background-position: center center;
			background-size: 100% 100%;
			background-repeat: no-repeat;
			box-sizing: border-box;
			margin-right: 20rpx;

			.hdWz {
				font-size: 30rpx;
				color: #222222;
				line-height: 1;
				margin-top: 46rpx;
			}

			&.w2 {
				width: 335rpx;
				height: 384rpx;

				&:nth-child(2n) {
					margin-right: 0;
				}

				.kuan {
					width: 146rpx;
					height: 146rpx;
				}
			}

			&.w3 {
				width: 220rpx;
				height: 252rpx;
				margin-right: 15rpx;

				&:nth-child(3n) {
					margin-right: 0;
				}

				.kuan {
					width: 96rpx;
					height: 96rpx;
				}
			}

			&.w4 {
				width: 157.5rpx;
				height: 180rpx;

				&:nth-child(4n) {
					margin-right: 0;
				}

				.kuan {
					width: 68rpx;
					height: 68rpx;
				}

				.hdWz {
					margin-top: 35rpx;
				}
			}

			&.wu {
				background: #fff !important;
			}

			.kuan {
				display: block;
				background-color: #fff;
				box-sizing: border-box;
				display: flex;
				justify-content: center;
				align-items: center;

				image {
					width: 100%;
					height: 100%;
				}
			}

			&.on {
				.kuan {
					border: none;
					background-color: $color;
				}

				.hdWz {
					color: $color;
				}
			}
		}

	}

	.kpgg {
		width: 600rpx;
		display: flex;
		flex-direction: column;
		justify-content: center;
		align-items: center;
		z-index: 9999;

		image {
			width: 100%;
			border-radius: 10rpx;
			vertical-align: top;
			margin-bottom: 30rpx;
		}
	}

	.service_box {
		display: flex;
		flex-wrap: wrap;
		padding: 0 10rpx;
		box-sizing: border-box;

		.service_box_item {
			width: 25%;
			display: flex;
			align-items: center;
			flex-direction: column;
			margin-bottom: 35rpx;

			&.w2 {
				width: 50%;
			}

			&.w3 {
				width: 33.33%;
			}

			&.w4 {
				width: 25%;
			}

			&.w5 {
				width: 20%;
			}

			.service_box_iteM_SHOP_icon {
				width: 88rpx;
				height: 88rpx;

				image {
					width: 100%;
					height: 100%;
				}
			}

			.service_box_iteM_SHOP_text {
				color: #7F7F7F;
				font-size: 25rpx;
				margin-top: 10rpx;
			}
		}
	}


	.InAndOut {
		width: 100%;
		height: 160rpx;
		margin-top: 40rpx;
		display: flex;
		justify-content: space-between;

		.InAndOut_yq {
			display: flex;
			align-items: center;
			justify-content: space-between;
			width: calc(100% - 50% - 10rpx);
			height: 100%;
			box-sizing: border-box;

			image {
				width: 100%;
				height: 100%;
			}
		}
	}

	.kjrk {
		flex-wrap: wrap;
		width: 690rpx;
		display: flex;
		margin: 30rpx auto 0;

		image {
			width: 222rpx;
			margin-right: 12rpx;
			height: 260rpx;
			margin-bottom: 10rpx;

			&:nth-of-type(3n) {
				margin-right: 0;
			}
		}
	}

	.kjrks {
		flex-wrap: wrap;
		width: 690rpx;
		margin: 0 auto 30rpx;

		image {
			width: 340rpx;
			height: 282rpx;
		}
	}

	.mb52 {
		margin-bottom: 52rpx;
	}

	.mb32 {
		margin-bottom: 32rpx;
	}

	.mb42 {
		margin-bottom: 42rpx;
	}

	.mb72 {
		margin-bottom: 72rpx;
	}

	.venDetail {
		padding: 0 30rpx 14rpx;
		width: 100%;
		margin: 0 auto;
		background-color: #fff;
		border-radius: 0rpx 0rpx 8rpx 8rpx;
		box-sizing: border-box;

		.venTop {
			box-sizing: border-box;
			padding: 24rpx 0;

			.venImg {
				width: 84rpx;
				height: 84rpx;
				border: 1rpx solid #F3F3F3;
				border-radius: 50%;
				margin-right: 20rpx;
				flex: none;
			}

			.venLeft {
				flex: 1;
			}

			.venRight {
				flex: none;
				box-sizing: border-box;
				width: 100rpx;
				line-height: 44rpx;
				border-radius: 22rpx;
				border: 1px solid #CCCCCC;
				font-size: 24rpx;
				font-family: PingFangSC, PingFang SC;
				font-weight: 400;
				color: #666666;
				text-align: center;
				justify-content: center;

				image {
					width: 20rpx;
					height: 20rpx;
					margin-right: 8rpx;
				}
			}
		}

		.venBottom {
			box-sizing: border-box;
			border-top: 1rpx solid #E5E5E5;
			padding-top: 16rpx;

			.venLeft {
				flex: 1;
				line-height: 1.5;
			}

			.venRight {
				view {
					display: flex;
					align-items: center;
					justify-content: center;
					flex-direction: column;
					text-align: center;
					margin-left: 48rpx;

					image {
						width: 44rpx;
						height: 44rpx;
						margin-bottom: 10rpx;
					}
				}
			}
		}
	}

	.videoImg {
		position: absolute;
		width: 60rpx;
		height: 60rpx;
		top: 214rpx;
		right: 54rpx;
	}

	.kpggs {
		width: 604rpx;
		display: flex;
		flex-direction: column;
		justify-content: center;
		align-items: center;
		position: relative;
		z-index: 99999;

		.yhjCnt {
			width: 100%;
			min-height: 200rpx;
			position: relative;
			overflow-y: auto;
			max-height: 500rpx;

			image {
				width: 100%;
				min-height: 200rpx;
				position: absolute;
				left: 0;
				top: 0;
				right: 0;
				z-index: 1;
				bottom: 0;
			}

			.yhjBox {
				width: 448rpx;
				z-index: 2;
				height: 134rpx;
				background: #FFFFFF;
				margin: 0 auto 12rpx;
				position: relative;
				box-sizing: border-box;
				padding: 24rpx 30rpx;
				border-radius: 8rpx;
				overflow: hidden;

				&:last-of-type {
					margin-bottom: 0;
				}

				.yhjTip {
					width: 64rpx;
					height: 38rpx;
					background: linear-gradient(180deg, #FFF3E3 0%, #FFD8A8 100%);
					border-radius: 8rpx 0rpx 8rpx 0rpx;
					font-family: SourceHanSansSC, SourceHanSansSC;
					font-size: 22rpx;
					color: #823D08;
					line-height: 38rpx;
					text-align: center;
					position: absolute;
					left: 0;
					top: 0;
				}

				.left {
					flex: none;
					font-weight: bolder;
					font-size: 26rpx;
					color: $red;
					text-align: center;
					width: 150rpx;
					line-height: 36rpx;

					text {
						font-size: 48rpx;
						color: $red;
						line-height: 56rpx;
						margin-left: 4rpx;
					}

					&.b {
						text {
							margin-left: 0;
							margin-right: 4rpx;
						}
					}
				}

				.right {
					flex: 1;

					.f24 {
						color: #B2B2B2;
					}
				}
			}
		}

		image {
			width: 100%;
			vertical-align: top;
			z-index: 1;

			&.gbImg {
				width: 60rpx;
				margin-top: 60rpx;
			}

			&.coupon_front {
				width: 560rpx;
				margin-top: -60rpx;
				z-index: 2;
				margin-left: 6rpx;
			}

			&.ic_coin {
				width: 84rpx;
				height: 90rpx;
				left: 0;
				top: 512rpx;
				position: absolute;
			}
		}

		.coupon_btn {
			width: 300rpx;
			height: 114rpx;
			left: 50%;
			margin-left: -150rpx;
			bottom: 144rpx;
			position: absolute;
			z-index: 3;

			@keyframes zoom {
				from {
					transform: scale(1);
				}

				to {
					transform: scale(1.2);
				}
			}

			image {
				z-index: 3;
				animation: zoom 1s ease-in-out infinite alternate;
			}
		}

	}
</style>